package cn.tannn.ops.message.controller.pojo;

import cn.tannn.ops.message.constant.WebHookApp;
import cn.tannn.ops.message.constant.WebHookSecretType;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * webhook
 *
 * @author <a href="https://t.tannn.cn/">tan</a>
 * @version V1.0
 * @date 2024/8/23 上午10:37
 */
@Schema(description = "新增webhook")
@ToString
@Getter
@Setter
public class WebHookAdd {
    @Schema(description = "webhook名称")
    String name;
    /**
     * webhook地址
     */
    @Schema(description = "webhook地址", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank
    String url;

    /**
     * 密码密钥
     */
    @Schema(description = "webhook地址", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank
    String secret;

    /**
     * 签名类型：
     * @see WebHookSecretType
     */
    @Schema(description = "签名类型", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull
    WebHookSecretType secretType;

    /**
     * webhook地址所属app[钉钉，飞书，企业微信]
     * @see WebHookApp
     */
    @Schema(description = "webhook地址所属app", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull
    WebHookApp app;

}
